<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>书籍信息表</title>
</head>
<body>
<table style="border: solid">
    <tr>
        <th>id</th>
        <th>title</th>
        <th>price</th>
        <th>retail_price</th>
        <th>authors</th>
        <th>public</th>
        <th>option</th>
    </tr>
    {% for book in all_books %}
        <tr>
            <td>{{ book.id }}</td>
            <td>{{ book.title }}</td>
            <td>{{ book.price }}</td>
            <td>{{ book.retail_price }}</td>
            <td>
                {% for author in book.authors.all %}
                    {{ author.name }};
                {% endfor %}
            </td>
            <td>{{ book.pub.pubname }}</td>
            <td>
                <a href="/update_book/{{ book.id }}">更新</a>
                <a href="#" onclick="confirm('确认删除?')
                        ?this.href='/delete_book/{{ book.id }}':this.href='javasrcipt:void()';">删除</a>
            </td>
        </tr>
    {% endfor %}
</table>
<p><a href="/add_book/">添加书籍</a></p>
<p><a href="/search_title_form/">搜索书籍</a></p>
<p><a href="/logout/">退出登录</a></p>
</body>
</html>